﻿@{
    ViewBag.Title = "数据字典列表";
    Layout = "~/Views/Shared/_FrameLayout.cshtml";
}

@section scripts
{
    <script>
        $(document).ready(function () {
          
        


            var config = {
                title: '数据字典列表',
                url: '@Url.Action("GetList")',
                colNames: ['主键', '字典名称', '字典编码', '分组名称', '分组编号', '是否可用', '排序'],
                colModel: [
                    { name: 'Id', index: 'Id', width: 60, key: true, hidden: true },
                    { name: 'DictionayName', index: 'DictionayName', width: 60 },
                    { name: 'DictionayCode', index: 'DictionayCode', width: 30 },
                    { name: 'GroupName', index: 'GroupName', width: 60 },
                    { name: 'GroupCode', index: 'GroupCode', width: 30 },
                    {
                        name: 'Useable',
                        index: 'Useable',
                        width: 20,
                        align: 'center',
                        formatter: function (cellValue, options, rowObject) {
                            return cellValue ? "<span class='layui-btn layui-btn-mini'>启用</span>" : "<span class='layui-btn layui-btn-danger layui-btn-mini'>禁用</span>";
                        }
                    },
                    { name: 'SortIndex', index: 'SortIndex', width: 30 }
                ],
                sortname: 'SortIndex',
                sortorder: 'asc'
            };
            WikeGrid.Load(config);

            $("#goupId").find("li").first().find("a").click();
        });

        function getSub(code,dom) {

            $(dom).parent().parent().find("li").removeClass("active");
            $(dom).parent().addClass("active");
            var postData = $("#table_list").jqGrid("getGridParam", "postData");
            $.extend(postData, { GroupCode: code });
            $("#table_list").setGridParam({ search: true }).trigger("reloadGrid", [{ page: 1 }]);
           
        }
    </script>
}



 
  
    <div class="row">
        <div class="col-md-2">@Html.Action("Groups")</div>
        <div class="col-md-10">

            <form id="searchToolBar" class="alert alert-info form-inline toolbarsearch" action="">
                <div class="form-group">
                    <label for="DictionayName">字典名称</label>
                    <input type="text" id="DictionayName" name="DictionayName" autocomplete="off" class="form-control" placeholder="请输入关键字" />

                </div>
             
               
                <button class="btn btn-danger" id="btnSearch" type="button">
                    <i class="fa fa-search"></i>查询
                </button>
                <button class="btn btn-default" data-url="@Url.Action("Add")" id="btnAdd" type="button">
                    <i class="fa fa-plus"></i>添加
                </button>
                <button class="btn btn-default" data-url="@Url.Action("Edit")" id="btnEdit" type="button">
                    <i class="fa fa-reorder"></i> 编辑
                </button>
                @*<button class="btn btn-default" data-url="@Url.Action("Delete")" id="btnDelete" type="button">
                    <i class="fa fa-remove"></i> 删除
                </button>*@
               
            </form>
            <div class="jqGrid_wrapper">
                <table id="table_list"></table>
                <div id="pager_list"></div>
            </div>
        </div>

    </div>

 